Day 7: Managing Packages and Software

Package Managers

Install, update, inventory, and uninstall software.

RHEL = rpm

yum - Handles dependency downloads/installation

Debian = dpkg (/var/lib/dpkg/status = everything installed)

apt - Handles dependency downloads/installation


RPM

rpm -i <package> = Install package
rpm -e <package> = Uninstall package
rpm -h = Progress bar
rpm -V <package> = Verify software components exists
rpm -qi = Query installed
rpm -qa = Query all
rpm -U = Upgrade installed packages
rpm -qR = Query required packages


YUM

yum install <package> = Install package
yum localinstall <package> = Install from local repository
yum remove <package> = Uninstall package
yum update <package> = Update the package or all packages
yum info <package> = Info on package


APT

apt update = Update repos
apt ugrade = Install updated repos
apt install <package>
apt remove <package>
apt purge <package> = Uninstall and remove configuration files
apt version <package> = Version info of package
apt-get
apt-cache


.tar Files

Bundles multiple files together (tarball)

Tar: Creates 1 archive file
c = Create
x = Extract
v = Verbose
f = File
t = Contents (No Extraction)
j = bzip2
z = gzip
J = xz

tar -cvf tarball.tar file1 file2 file3
tar cJvf tarball.tar file1 file2 = Compress with xz


ldd <path/to/binary = view shared library dependencies for an app


LAB

createrepo /Directory = Designate directory as a YUM repo

Add a Repo
add a repo file in /etc/yum.repos.d/my-repo.repo

[local-repo]

name=Local Repository

baseurl=file:///Packages

enabled=1

gpgcheck=0

Verify Repo can be read by YUM
yum clean all
yum repolist
yum -y --enablerepo=repo.repo install <package>

Compiling source code
./configure after installing GCC
make install after compiling with GCC